; ORIGINAL: 3dt2.1/examples/pan10.scm
; $Id: pan10.scm,v 1.4 1997/04/30 20:24:15 jread Exp $
;- pan10.scm ----------------------------------------------------
; Define procedures to pan left, right, up, down, in and out.
; Slow the process down to a visually appealing rate with system:sleep.
;------------------------------------------------------------------
(define offset
  (lambda (delta view-name)
    (do ((i 0 (+ i 1))) ((= i 10))
      (begin
        (view:set-eye (position:offset (view:eye view-name) delta) view-name)
        (view:set-target (position:offset (view:target view-name) delta) view-name)
        (view:refresh view-name)
        (system:sleep 50)))))

(define panl
  (lambda (view-name)
    (offset (gvector 1 0 0) view-name)))

(define panr
  (lambda (view-name)
    (offset (gvector -1 0 0) view-name)))

(define panu
  (lambda (view-name)
    (offset (gvector 0 -1 0) view-name)))

(define pand
  (lambda (view-name)
    (offset (gvector 0 1 0) view-name)))

(define pani
  (lambda (view-name)
    (offset (gvector 0 0 1) view-name)))

(define pano
  (lambda (view-name)
    (offset (gvector 0 0 -1) view-name)))

